package _06线程池的使用_Callable方式;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService pool = Executors.newFixedThreadPool(4);
        MyCallable myCallable=new MyCallable();
        Future<Integer> future = pool.submit(myCallable);
        Integer integer = future.get();
        System.out.println(integer);
    }
}
